package com.xu.service;

import com.xu.mapper.OrderMapper;
import com.xu.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService{

    @Autowired
    private OrderMapper orderMapper;

    public void setOrderMapper(OrderMapper orderMapper) {
        this.orderMapper = orderMapper;
    }

    public List<Order> queryAllOrder() {
        return orderMapper.queryAllOrder();
    }

    public int delOrder(int id) {
        return orderMapper.delOrder(id);
    }

    public int updOrder(Order order) {
        return orderMapper.updOrder(order);
    }

    public int selectOrderNum()
    {
        return orderMapper.selectOrderNum();
    }

    public Order queryOrderById(int id)
    {
        return orderMapper.queryOrderById(id);
    }

    public List<Order> queryOrderByUserId(int userid)
    {
        return orderMapper.queryOrderByUserId(userid);
    }

    public int addOrder(Order order)
    {
        return orderMapper.addOrder(order);
    }

}
